package vfs.obj.entity.impl;

import vfs.obj.entity.VFSEntity;

/**
 *
 * @author Matthew Eavenson <durandal@uga.edu>
 */
public abstract class VFSEntityImpl implements VFSEntity{
    
    private long id;
    
    @Override
    public long getId(){
        return id;
    }
    
    @Override
    public void setId(long id){
        this.id = id;
    }
    
    @Override
    public boolean isProxy(){
        return id != -1;
    }
    
    @Override
    public boolean equals(Object obj){
        if(obj instanceof VFSEntity){
            return ((VFSEntity)obj).getId() == id;
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 47 * hash + (int) (this.id ^ (this.id >>> 32));
        return hash;
    }
    
}
